<template>
	<view>
		<image src="../../static/l-bg.png" mode="widthFix" style="width: 100%;"></image>
		<view class="input-group">
			<view class="secetion-box">
				<view class="label">
					账号
				</view>
				<view class="inp">
					<input type="number" :maxlength="11" value="" v-model="phone" placeholder="请输入账号" />
				</view>
			</view>
			<view class="secetion-box">
				<view class="label">
					密码
				</view>
				<view class="inp">
					<input type="password" :maxlength="20" value="" v-model="pwd" placeholder="请输入密码" />
				</view>
			</view>
			<view class="button">
				<button type="default" @click="next">登录</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				phone:'18202821297',
				pwd:'666666'
			};
		},
		methods:{
			next(){
				this.$reg.isPhone(this.phone)
				if(!this.pwd){
					this.$tools.msg('请输入密码')
					return false
				}
				this.$api.sign({
					phone:this.phone,
					pwd:this.pwd,
					gt_client_id:plus.push.getClientInfo().clientid
				}).then(res=>{
					if(res.data.code==1){
						this.$tools.msg(res.data.msg)
						uni.setStorageSync('userInfo',res.data.data)
						setTimeout(()=>{
							this.$tools.switchGo('../add-inventory/add-inventory')
						},1000)
					}
				}).catch(err=>{
					console.log(err)
				})
			},
		}
	}
</script>

<style lang="less" scoped>
.input-group{
	width: 630upx;
	margin: 30upx auto;
	display: flex;
	flex-direction: column;
	.secetion-box{
		width: 100%;
		margin-bottom: 70upx;
		.label{
			font-size: 24upx;
			color: #333333;
		}
		.inp{
			width: 100%;
			border-bottom: 1upx solid #e6e6e6;
			padding: 15upx 0;
			margin-top: 25upx;
			input{
				width: 100%;
				font-size: 24upx;
			}
		}
	}
	.button{
		width: 100%;
		button{
			width: 100%;
			background: #21E6C1;
			font-size: 32upx;
			color: #FFFFFF;
			height: 100upx;
			line-height: 100upx;
		}
	}
}
</style>
